package cn.com.git.admin.common;

import cn.com.git.common.base.BaseResultConstant;

/**
 * @author zhangzhenfu
 * @Description
 * @date 2020/4/8 14:55
 */
public enum UpmsResultConstant implements BaseResultConstant {
    /**
     * 失败
     */
    FAILED(false, 0, "操作失败"),

    /**
     * 成功
     */
    SUCCESS(true, 1, "操作成功"),

    /**
     * 无效长度
     */
    INVALID_LENGTH(false, 10001, "Invalid length"),

    /**
     * 用户名不能为空
     */
    EMPTY_USERNAME(false, 10101, "Username cannot be empty"),

    /**
     * 密码不能为空
     */
    EMPTY_PASSWORD(false, 10102, "Password cannot be empty"),

    /**
     * 帐号不存在
     */
    INVALID_USERNAME(false, 10103, "Account does not exist"),

    /**
     * 密码错误
     */
    INVALID_PASSWORD(false, 10104, "Password error"),

    /**
     * 无效帐号
     */
    INVALID_ACCOUNT(false, 10105, "Invalid account"),

    /**
     * 未登录
     */
    NOT_LOGIN(false, 20001, "Not logged in"),

    /**
     * 已登录
     */
    ALREADY_LOGIN(true, 20002, "Already logged in")

    ;
//
//    private static Map<Integer,String> enumMap = new HashMap<>();
//    static {
//        UpmsResultConstant[] list = UpmsResultConstant.values();
//        for(UpmsResultConstant e:list){
//            enumMap.put(e.code,e.message);
//        }
//    }


    private boolean success ;

    private int code;

    private String message;

    UpmsResultConstant(boolean success,int code, String message) {
        this.code = code;
        this.message = message;
        this.success=success;
    }

    @Override
    public boolean getSuccess() {
        return success;
    }

    @Override
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
